package com.example.lms.controller;

import com.example.lms.entity.Warehouses;
import com.example.lms.service.WarehousesService;
import com.example.lms.vo.D;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @module
 * @author：DUOLUONIANDAI
 * @DATA：2024/05/13
 * @Title：仓库
 */

@RestController
public class WarehousesController {

    @Resource
    WarehousesService warehousesService;

    /**
     * @param
     * @return
     * @Title Api fox-api
     * @api.name 添加仓库的信息
     * @folder 仓库
     */

    @PostMapping("saveWarehouses")
    public D saveWarehouses(@RequestBody Warehouses warehouses){
        return warehousesService.addWarehousesInfo(warehouses);
    }

    /**
     * @param
     * @return
     * @Title Api fox-api
     * @api.name 查询仓库信息
     * @folder 仓库
     */

    @GetMapping("getWarehousesInfo")
    public D getWarehousesInfo(@RequestParam("id") String id){
        return warehousesService.getWarehousesInfo(id);
    }

    /**
     * @param
     * @return
     * @Title Api fox-api
     * @api.name 删除仓库的信息
     * @folder 仓库
     */

    @DeleteMapping("delWarehouses")
    public D delWarehouses(@RequestParam("id") String id){
        return warehousesService.delWareHouses(id);
    }

    /**
     * @param
     * @return
     * @Title Api fox-api
     * @api.name 修改仓库的信息
     * @folder 仓库
     */

    @PutMapping("uplocadWarehouses")
    public D uplocadWarehouses(@RequestBody Warehouses warehouses){
        return warehousesService.uploadWareHouses(warehouses);
    }


}
